home *** CD-ROM | disk | FTP | other *** search
/ Macmillan Math: Grade 1 …Pupil's Edition (Florida) / Math Grade 1 - Pupil's Edition (Florida).iso / pc / corsair / generic / javascript / navigation / navigation.js < prev   
Encoding:
Text File  |  2004-04-17  |  4.1 KB  |  166 lines

  1. function getNextPage(curPage){
  2.      leng = coRel.length;
  3.      j=0;
  4.      nextPage = '';
  5.      found=false;
  6.      for(i=0;i<leng;i++){
  7.         if (coRel[i][0] == curPage){
  8.             j=i;
  9.             for(j=i;j<leng;j++){
  10.                 if (coRel[j][0] != curPage){
  11.                     nextPage=coRel[j][0];
  12.                     found=true;
  13.                     break;
  14.                 }
  15.             }
  16.             if (found){
  17.                 break;
  18.             }            
  19.         }
  20.      }
  21.     return nextPage;
  22.     }
  23.  
  24.     function getPrevPage(curPage){
  25.      leng = coRel.length;
  26.      j=0;
  27.      prevPage = '';
  28.      found=false;
  29.      for(i=0;i<leng;i++){
  30.         if (coRel[i][0] == curPage){
  31.             j=i;
  32.             for(j=i;j<leng;j--){
  33.                 if (coRel[j][0] != curPage){
  34.                     prevPage=coRel[j][0];
  35.                     found=true;
  36.                     break;
  37.                 }
  38.             }
  39.             if (found){
  40.                 break;
  41.             }            
  42.         }
  43.      }
  44.      return prevPage;
  45.     }
  46.  
  47.     function getCurrentPage(curPage){
  48.      leng = coRel.length;
  49.      j=0;
  50.      currentPage = '';
  51.      found=false;
  52.  
  53.      for(i=0; i<leng; i++){
  54.         if (coRel[i][1] == curPage){
  55.             found=true;
  56.             currentPage = coRel[i][0];
  57.             break;
  58.         }
  59.      }
  60.      return currentPage;
  61.     }
  62.  
  63.     function goPrevPage(curPage, isbn) {
  64.         var queryString = location.search;
  65.         pg=getPrevPage(curPage);
  66.         if(queryString.length > 45) {
  67.             window.document.location = (servletName+"?ACTION=0&FILE="+pg+".html&ISBN="+isbn+"&TWEISBN="+tweisbn);
  68.         } else {
  69.             window.document.location = (servletName+"?ACTION=0&FILE="+pg+".html&ISBN="+isbn);            
  70.         }
  71.     }
  72.  
  73.     function goPrevTwePage(curPage,isbn) {
  74.         pg=getPrevPage(curPage);
  75.         window.document.location = (servletName+"?ACTION=0&FILE="+pg+".html&UT=1&ISBN="+isbn);
  76.     }
  77.  
  78.     function goNextPage(curPage,isbn) {
  79.         var queryString = location.search;
  80.         pg1=getNextPage(curPage);
  81.         if(queryString.length > 45) {
  82.             window.document.location = (servletName+"?ACTION=0&FILE="+pg1+".html&ISBN="+isbn+"&TWEISBN="+tweisbn);
  83.         } else {
  84.             window.document.location = (servletName+"?ACTION=0&FILE="+pg1+".html&ISBN="+isbn);            
  85.         }
  86.     }
  87.  
  88.     function goNextTwePage(curPage,isbn) {
  89.         pg1=getNextPage(curPage);
  90.         window.document.location = (servletName+"?ACTION=0&FILE="+pg1+".html&UT=1&ISBN="+isbn);
  91.     }
  92.  
  93.     function goToPage(isbn){
  94.         //alert("test");
  95.         txtvalue=document.forms['gotoPage'].PAGENUM.value;    
  96.         pg = getCurrentPage(txtvalue);
  97.         var width = getWidth( 350 );
  98.         var height = 170;
  99.         var features = "scrollbars='no',top=0,left=0,width=" + width + ",height=" + height;
  100.         
  101.         //alert("Page number="+pg);
  102.         url = '../../../../generic/html/noSuchPage.html?page='+txtvalue;
  103.         if (pg == ''){
  104.             window.open(url, "errorPage", features, true).focus();
  105.         }
  106.         else{
  107.             window.document.location = (servletName+"?ACTION=0&FILE="+pg + ".html&ISBN="+isbn);
  108.         }
  109.     }
  110.  
  111.     function goToLinkPage(isbn,pg) {    
  112.         pg = getCurrentPage(pg);
  113.         var width = getWidth( 320 );
  114.         var height = 170;
  115.         var features = "scrollbars='no',top=0,left=0,width=" + width + ",height=" + height;
  116.     
  117.         url = '../../../../generic/html/noSuchPage.html?page='+pg;
  118.         if (pg == ''){
  119.             window.open(url, "errorPage", features, true).focus();
  120.         }
  121.         else{
  122.             window.document.location = (servletName+"?ACTION=0&FILE="+pg + ".html&ISBN="+isbn);
  123.         }
  124.         
  125.     }
  126.  
  127.     function goToLinkPageToParent(isbn,pg) {    
  128.     opener.location.href = servletName+"?ACTION=0&FILE="+pg + ".html&ISBN="+isbn;
  129.     window.close();
  130.     }
  131.  
  132.  
  133.     function goToTwePage(isbn) {
  134.         //alert("test");
  135.         txtvalue=document.forms['gotoPage'].PAGENUM.value;    
  136.         pg = getCurrentPage(txtvalue);
  137.         var features = "scrollbars='no',top=0,left=0,width=350,height=170";
  138.         
  139.         url = '../../../../generic/html/noSuchPage.html';
  140.         if (pg == ''){
  141.             window.open(url, "errorPage", features, true).focus();
  142.         }
  143.         else{
  144.             window.document.location = (servletName+"?ACTION=0&FILE="+pg + ".html&ISBN="+isbn);
  145.         }
  146.     }
  147.  
  148.     function referToPage(txtvalue, isbn) {
  149.         pg = getCurrentPage(txtvalue);
  150.         var features = "scrollbars='no',top=0,left=0,width=350,height=170";
  151.                 
  152.         url = '../../../../generic/html/noSuchPage.html?page='+txtvalue;
  153.         if (pg == ''){
  154.             window.open(url, "errorPage", features, true).focus();
  155.         }
  156.         else{
  157.             window.document.location = (servletName+"?ACTION=0&FILE="+pg + ".html&ISBN="+isbn);
  158.         }
  159.     }
  160.  
  161.     
  162.     function loadParentPage(isbn, page ) {
  163.         pg = getCurrentPage(page);
  164.         window.opener.location.href = servletName+"?ACTION=0&FILE=" + pg + ".html&ISBN="+isbn;
  165.         window.close();
  166.     }